package query_understanding.common.nlp_toolkit;


import edu.stanford.nlp.ling.IndexedWord;
import edu.stanford.nlp.semgraph.SemanticGraphEdge;
import javafx.util.Pair;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by julianzliu on 4/24/2017.
 */

/*
首尾相连的三元组序列
三元组 -> RelationEdge
 */


public class RelationTriplePath {

    public IndexedWord startNode;

    public List<RelationEdge.BaseRelation> path;

    public RelationTriplePath(){
        this.path = new ArrayList<>();
    }




    @Override
    public String toString(){
        String path_str = "";
        path_str += " [" + startNode + "] ";
        for(RelationEdge.BaseRelation edge : path){
            path_str += " ( " + edge.linkPoint + "--> " + edge.inEdge.getRelation().getShortName()  + " --> "
                    + edge.relation + " --> " ;
            if(edge.otherSide != null)
                    path_str +=  edge.outEdge.getRelation().getShortName() + " --> " + edge.otherSide + " ) ";
        }
        return path_str;
    }
}
